package com.csx.saas.merchant.tenant.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.csx.basic.base.service.SuperCacheServiceImpl;
import com.csx.basic.cache.model.CacheKeyBuilder;
import com.csx.saas.common.cache.tenant.TenantCacheKeyBuilder;
import com.csx.saas.merchant.tenant.dao.TenantMapper;
import com.csx.saas.merchant.tenant.entity.Tenant;
import com.csx.saas.merchant.tenant.service.TenantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 业务实现类
 * 企业
 * </p>
 *
 * @author ChenSongXin
 * @date 2021-03-15
 */
@Slf4j
@Service
@DS("#thread.tenant")
public class TenantServiceImpl extends SuperCacheServiceImpl<TenantMapper, Tenant> implements TenantService {

    @Override
    protected CacheKeyBuilder cacheKeyBuilder() {
        return new TenantCacheKeyBuilder();
    }

    protected TenantService currentProxy() {
        return ((TenantService) AopContext.currentProxy());
    }
}
